# Maintainer: Norbert Pfeiler <norbert.pfeiler+aur ät gmail.com>

_realname=cotire
pkgbase=mingw-w64-${_realname}
pkgname="$MINGW_PACKAGE_PREFIX-$_realname"
_cotirever=1.7.8
_cmakever=3.6
_cmakegooduntil=3.7
pkgver=${_cotirever}_${_cmakever}
pkgrel=1
pkgdesc='CMake module to speed up builds (automated PCH, unity builds). (mingw-w64)'
arch=(any)
license=('custom')
conflicts=("$MINGW_PACKAGE_PREFIX-cmake<$_cmakever" "$MINGW_PACKAGE_PREFIX-cmake>=$_cmakegooduntil") # the Modules dir changes every major release
url='https://github.com/sakra/cotire'
source=("https://github.com/sakra/cotire/archive/$_realname-$_cotirever.tar.gz")
sha256sums=('84be4ff66248ba629666bed5c2b76b869db7f04425e44bba3555bbc25d5701c1')

package() {
  cd "$_realname-$_realname-$_cotirever"

  modules_dir="$pkgdir$MINGW_PREFIX/share/cmake-$_cmakever/Modules/"
  mkdir -p $modules_dir
  cp CMake/cotire.cmake $modules_dir

  license_dir="$pkgdir$MINGW_PREFIX/share/licenses/cotire/"
  mkdir -p $license_dir
  cp license $license_dir
}
